using System;
using System.Collections.Generic;
using Castle.ActiveRecord;
using Karma.Framework.Core.Domain;

namespace Karma.Framework.Core.Modules.Reports.Definition
{
    [ActiveRecord("[Criteria]", Mutable = false)]
    public class Criteria: DomainObject
    {
        [JoinedKey]
        public override Int64 Id { get; set; }

        [Property]
        public string Expression { get; set; }

        [Property(NotNull = true)]
        public CriteriaType Type { get; set; }

        [HasMany(typeof(Criteria), Cascade = ManyRelationCascadeEnum.All,
            Lazy = false, ColumnKey = "[CriteriaOwner]", Table = "[Criteria]")]
        public IList<Criteria> Criterions { get; set; }

        public string ParameterName { get; set; }

        public string DataType { get; set; }

        public IList<string> OperandValues { get; set; }
        
    }
}